/**
 * Course Project for User Interface Programming I, 2011
 * Group 19
 */
package justdoit.actions;

import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import javax.swing.AbstractAction;
import javax.swing.ImageIcon;
import javax.swing.KeyStroke;
import justdoit.controller.TaskManager;
import justdoit.controller.LanguageManager;
import justdoit.view.UserSettingsDialog;
import justdoit.controller.IconManager;

/**
 * 
 * @author Can
 */
public class UserSettingsAction extends AbstractAction {

    public UserSettingsAction() {
        super(LanguageManager.getString("menu.user.settings"), IconManager.getIcon("settings.png"));
        putValue(MNEMONIC_KEY, LanguageManager.getMnemonic("mnemonic.menu.user.settings"));
        putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke("alt S"));
    }

    public UserSettingsAction(String text) {
        super(text);
    }

    public UserSettingsAction(String text, ImageIcon icon) {
        super(text, icon);
    }

    public UserSettingsAction(String text, ImageIcon icon,
            String desc, Integer mnemonic) {
        super(text, icon);
        putValue(SHORT_DESCRIPTION, desc);
        putValue(MNEMONIC_KEY, mnemonic);
    }

    public void actionPerformed(ActionEvent e) {
        UserSettingsDialog usd = new UserSettingsDialog(TaskManager.getCurrentUser());
        usd.setVisible(true);
    }
}
